--[[ 编码: WMS-20-22 名称: 作者: 日期:2025-1-29 函数: main 功能: -- 在呼出空料箱后操作者可以点取消,这个时候会删除新创建的入库波次 -- 并且取消呼出容器的预分配数量,及料格的状态 更改记录: V2.0 HAN 20250317 增加对超重呼出料箱功能点的处理,取消后要把【站台货品明细】的N_B_STATE状态设置为 0 --]] json = require ("json") mobox = require ("OILua_JavelinExt") m3 = require("oi_base_mobox") function main( strLuaDEID ) local nRet, strRetInfo, parameter -- 这里的 paramter 是在点击领用按钮后,传入的 入库波次对象,如果取消就是删除波次对象 nRet, parameter = m3.GetSysInputParameter( strLuaDEID ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取input parameter 失败! "..parameter ) end local from = parameter.from if ( from == "Overweight_call" ) then -- 呼出空料箱来自 站台的超重货品入库呼出,需要把【站台货品明细】中相关的记录更新状态 local station = lua.Get_StrAttrValue( parameter.station ) local bs_type = lua.Get_StrAttrValue( parameter.bs_type ) local bs_no = lua.Get_StrAttrValue( parameter.bs_no ) if ( station == '' or bs_type == '' or bs_no == '' ) then mobox.stopProgram( strLuaDEID, "paramter 参数中 属性 station, bs_type, bs_no 不能为空!") return end strCondition = "S_STATION_NO = '"..station.."' AND S_BS_TYPE = '"..bs_type.."' AND S_BS_NO = '"..bs_no.."'" strSetAttr = "N_B_STATE = 0" -- 0 待处理 nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Station_Goods_Detail", strCondition, strSetAttr ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "更新【站台货品明细】信息失败!"..strRetInfo ) end end local strCondition = "S_ID = '"..parameter.obj_id.."'" nRet, strRetInfo = mobox.deleteDataObject( strLuaDEID, parameter.cls_id, strCondition ) if ( nRet ~= 0) then return lua.Error( strLuaDEID, debug.getinfo(1), "删除【parameter.cls_id】失败! "..strRetInfo ) end local action = { { action_type = "close_dlg", value = "" } } nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end end